# scripts/auth.py
import os
import earthaccess


def earthdata_login():
    if not os.path.exists(os.path.expanduser("~/.netrc")):
        raise FileNotFoundError("❌ 请先配置 .netrc 文件以登录 Earthdata。")
    earthaccess.login(strategy="netrc")
